package com.szbmyoubao.app.utils

import android.content.Context
import android.media.MediaScannerConnection
import android.net.Uri
import android.os.Build
import android.os.Environment
import com.ellecity06.common.utils.appContext
import java.io.File

/**
 * @author ellecity06
 * @time 2024/11/4 18:57
 * @des
 */
class FileUtils {
    companion object {

        fun getDownLoadFile(): File {
            // 区分android 10
            return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q){
                File(
                    appContext.externalCacheDir,
                    "jdg")

            }else {
                File(
                    Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES),
                    "jdg"
                )
            }

        }

        fun notifyAlumb(context: Context, paths: Array<String>) {
            MediaScannerConnection.scanFile(
                context,
                paths,
                null
            ) { path, uri -> }
        }
    }
}